# Contributor: Antoine Fontaine <antoine.fontaine@epfl.ch>
# Maintainer: Peter Shkenev <santurysim@gmail.com>
pkgname=py3-wheel
pkgver=0.43.0
pkgrel=0
pkgdesc="built-package format for Python"
url="https://github.com/pypa/wheel"
arch="noarch"
license="MIT"
depends="python3 py3-packaging"
makedepends="
	py3-flit-core
	py3-gpep517
	"
checkdepends="py3-pytest py3-setuptools python3-dev"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/w/wheel/wheel-$pkgver.tar.gz
	use-system-packaging.patch
	"
builddir="$srcdir"/wheel-$pkgver
options="!check" # circular with pytest

prepare() {
	default_prepare

	rm -rf src/wheel/vendored
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages test-env
	test-env/bin/python3 setup.py install
	test-env/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
b6213c05263026884c07bdc4d529252f0be013c3fc6d0558008b7130ba90d4ef11e57f155f62f5e2528ddcd78d188530b2b7c78acc15b8168f64935fe6e6393b  wheel-0.43.0.tar.gz
c937b20ab67c68bf343833a73cc235359584a523dd491d5bd3fcb59ff46ad0e49ccd6a8f8eab9d8e139061505ca7089c4f9e4df6df075920c721ba961d62a784  use-system-packaging.patch
"
